// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless.Core.ReindexRethrottle;

public sealed partial class ReindexStatus
{
	/// <summary>
	/// <para>The number of scroll responses pulled back by the reindex.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("batches")]
	public long Batches { get; init; }

	/// <summary>
	/// <para>The number of documents that were successfully created.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("created")]
	public long Created { get; init; }

	/// <summary>
	/// <para>The number of documents that were successfully deleted.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("deleted")]
	public long Deleted { get; init; }

	/// <summary>
	/// <para>The number of documents that were ignored because the script used for the reindex returned a `noop` value for `ctx.op`.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("noops")]
	public long Noops { get; init; }

	/// <summary>
	/// <para>The number of requests per second effectively executed during the reindex.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("requests_per_second")]
	public float RequestsPerSecond { get; init; }

	/// <summary>
	/// <para>The number of retries attempted by reindex. `bulk` is the number of bulk actions retried and `search` is the number of search actions retried.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("retries")]
	public Elastic.Clients.Elasticsearch.Serverless.Retries Retries { get; init; }
	[JsonInclude, JsonPropertyName("throttled")]
	public Elastic.Clients.Elasticsearch.Serverless.Duration? Throttled { get; init; }

	/// <summary>
	/// <para>Number of milliseconds the request slept to conform to `requests_per_second`.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("throttled_millis")]
	public long ThrottledMillis { get; init; }
	[JsonInclude, JsonPropertyName("throttled_until")]
	public Elastic.Clients.Elasticsearch.Serverless.Duration? ThrottledUntil { get; init; }

	/// <summary>
	/// <para>This field should always be equal to zero in a `_reindex` response.<br/>It only has meaning when using the Task API, where it indicates the next time (in milliseconds since epoch) a throttled request will be executed again in order to conform to `requests_per_second`.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("throttled_until_millis")]
	public long ThrottledUntilMillis { get; init; }

	/// <summary>
	/// <para>The number of documents that were successfully processed.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("total")]
	public long Total { get; init; }

	/// <summary>
	/// <para>The number of documents that were successfully updated, for example, a document with same ID already existed prior to reindex updating it.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("updated")]
	public long Updated { get; init; }

	/// <summary>
	/// <para>The number of version conflicts that reindex hits.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("version_conflicts")]
	public long VersionConflicts { get; init; }
}